v4.0.2 to NEXT
Standalone Components Migration
- Open a terminal into your angular root project
- Run command
ng g @angular/core:standalone
- Select Convert standalone
- Choose current root path of your project and validate
- Run command
ng g @angular/core:standalone
again- Select Remove modules
- Choose current root path of your project and validate
- Commit the changes
Angular 19 Migration
Editor's migration guides
Angular CDK (v16 -> v17)
- Open a terminal into your angular root project
- Run command
ng update @angular/cdk@17
, you'll have the following automatic migrations :- From @angular/cdk@18
- Updates the Angular CDK to v17
- From @angular/cdk@18
- Commit the changes
Angular Core (v17 -> v18)
- Run command
ng update @angular/core@18 @angular/cli@18 @angular-eslint/schematics@18
, you'll have the following automatic migrations :- From @angular-eslint/schematics@18
- Updates @angular-eslint to v18.2
- From @angular/cli
- Migrate application projects to the new build system : you'll have to accept the migration action
use-application-builder
- Migrate application projects to the new build system : you'll have to accept the migration action
- From @angular/core
- Replace deprecated HTTP related modules with provider functions
- Updates calls to afterRender with an explicit phase to the new API
- From @angular-eslint/schematics@18
- Commit the changes
Angular Packages (v17 -> v18)
- Run command
ng update @angular/cdk@18 @ngrx/store@18 @ngrx/store-devtools@18 keycloak-angular@16 primeng@18
, you'll have the following automatic migrations :- From @angular/cdk@18
- Updates the Angular CDK to v18
- From @ngrx/effects
- As of NgRx v18, the
concatLatestFrom
import has been removed from@ngrx/effects
in favor of the@ngrx/operators
package
- As of NgRx v18, the
- From @ngrx/store
- As of NgRx v18, the
TypedAction
has been removed in favor ofAction
- As of NgRx v18, the
- From @angular/cdk@18
- Commit the changes
Angular Core + Packages (v18 -> v19)
- Run command
ng update @angular/core@19 @angular/cli@19 @angular-eslint/schematics@19 @angular/cdk@19 @ngrx/store@19 @ngrx/store-devtools@19 keycloak-angular@19 primeng@19
, you'll have the following automatic migrations :- From @angular/cli
- Update '@angular/ssr' import paths to use the new '/node' entry point when 'CommonEngine' is detected
- Update the workspace configuration by replacing deprecated options in 'angular.json' for compatibility with the latest Angular CLI changes
- Migrate application projects to the new build system : you'll have to ignore the migration action
use-application-builder
- From @angular/cdk@19
- Updates the Angular CDK to v19
- From @angular/core
- Updates non-standalone Directives, Component and Pipes to 'standalone:false' and removes 'standalone:true' from those who are standalone
- Updates ExperimentalPendingTasks to PendingTasks
- Replaces
APP_INITIALIZER
,ENVIRONMENT_INITIALIZER
&PLATFORM_INITIALIZER
respectively withprovideAppInitializer
,provideEnvironmentInitializer
&providePlatformInitializer
: you'll have to accept the migration actionprovide-initialize
- From @ngrx/effects
- As of NgRx v18, the
concatLatestFrom
import has been removed from@ngrx/effects
in favor of the@ngrx/operators
package
- As of NgRx v18, the
- From @ngrx/store
- As of NgRx v18, the
TypedAction
has been removed in favor ofAction
- As of NgRx v18, the
- From @angular/cli
- Commit the changes
AUTOMATIC MIGRATION
-
Use the BIAToolKit to migrate the project
-
Delete all package-lock.json and node_modules folder
-
Manage the conflicts (2 solutions)
- In BIAToolKit click on "4 - merge Rejected" and search
<<<<<
in all files.
- Resolve the conflicts manually.
- Analyze the .rej file (search "diff a/" in VS code) that have been created in your project folder
- Apply manually the change.
- In BIAToolKit click on "4 - merge Rejected" and search
-
Download the migration script and the standalone catch up script into the same directory
-
Change source path of the migration script and run it
-
Apply other manual step (describe below) at the end if all is ok, you can remove the .rej files (during the process they can be useful to resolve build problems)
-
Resolve missing and obsolete usings with BIAToolKit
-
Launch the command npm install and the command npm audit fix
MANUAL STEPS
FRONT
- Remove node_modules directory from your project, then run
npm i
command - Replace
HttpClientModule
import byprovideHttpClient(withInterceptorsFromDi())
into the providers :
Before
import { HttpClientModule } from '@angular/common/http';
@NgModule({
imports: [
HttpClientModule
]
})
After
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
@NgModule({
providers: [
provideHttpClient(withInterceptorsFromDi())
]
})
- Replace all
@Output
properties with native event names such ascancel
,click
by another names (ex:cancelled
,clicked
) - Remove
Time
usage from your code - Adapt the usage of
<p-tabs>
migrated from<p-tabView>
:- Add
<p-tablist>
inside and under<p-tabs>
- For each existing
<p-tabpanel>
, add a<p-tab>
inside<p-tablist>
with an incremental numeric propertyvalue
, with the inner content of previousheader
property of the<p-tabpanel>
or of the<ng-template pTemplate="header">
content - Replace for each existing
<p-tabpanel>
propertyheader
byvalue
with corresponding value of the added<p-tab>
- Add into the
<p-tabs>
a propertyvalue
with the same identifier as your target tab to set as active by default
- Add
Before
<p-tabView>
<p-tabPanel *ngFor="let tab of tabs" header="tab.title">
{{ tab.content }}
</p-tabPanel>
</p-tabView>
<p-tabView>
<p-tabPanel *ngFor="let tab of tabs">
<ng-template pTemplate="header">
{{ tab.title }}
</ng-template>
{{ tab.content }}
</p-tabPanel>
</p-tabView>
After
<p-tabs [value]="0">
<p-tablist>
@for (tab of tabs; track $index) {
<p-tab [value]="$index">
{{ tab.title }}
</p-tab>
}
</p-tablist>
@for (tab of tabs; track $index) {
<p-tabpanel [value]="$index">
{{ tab.content }}
</p-tabpanel>
}
</p-tabs>
- Fix the automatic replacements of
<p-floatlabel>
to the correct HTML tag if any - Fix the automatic replacements of
<p-fluid>
to the correct HTML tag if any - For each
<p-checkbox>
with label, add intodiv
parent container the classesflex items-center
Before
<div>
<p-checkbox></p-checkbox>
<label>Something</label>
</div>
After
<div class="flex items-center">
<p-checkbox></p-checkbox>
<label>Something</label>
</div>
- The eslint plugin
eqeqeq
(forcing usage of === instead of ==) should be activated after migration. You can keep it activated and fix all lint errors or you can deactivate it in the .eslintrc file of your project by changing every line where eqeqeq appears by :
"eqeqeq": "off"
- Moving advanced filters to the right :
- Move advanced filter html after table in index.component
- Move from table-header to table-controller html :
[showBtnFilter]="true"
[showFilter]="showAdvancedFilter"
[hasFilter]="hasAdvancedFilter"
(openFilter)="onOpenFilter()"
- Replace into your .scss files the usage of
@import
by@use
and add the import file name as suffix of the concerned properties
Before
@import '../theme'
button {
color: $button-color /* From theme */
}
After
@use '../theme'
button {
color: theme.$button-color
}